#ifndef __CE_WAITGROUP_H__
#define __CE_WAITGROUP_H__

#include "ce_core.h"

typedef struct {
    ce_atomic_t     count;
    char            name[26];
    sem_t          *sem;
} ce_waitgroup_t;

void ce_waitgroup_init(ce_waitgroup_t *wg);

void ce_waitgroup_add(ce_waitgroup_t *wg);
void ce_waitgroup_done(ce_waitgroup_t *wg);
void ce_waitgroup_wait(ce_waitgroup_t *wg);

#endif
